﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using SMS.Shell.Views;
using SMS.Shell.Windows;

namespace SMS.Shell
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void _btnInstall_Click(object sender, RoutedEventArgs e)
        {
            if (new SMS.Domain.SmsService().Install())
            {
                MessageBox.Show("安装成功!");
            }
            else
            {
                MessageBox.Show("安装失败!");
            }
        }

        private void _btnCargoManagement_Click(object sender, RoutedEventArgs e)
        {
            _frame.Navigate(new CargoListView());
        }

        private void _btnCustomerManagement_Click(object sender, RoutedEventArgs e)
        {
            _frame.Navigate(new CustomerListView());
        }

        private void _btnSend_Click(object sender, RoutedEventArgs e)
        {
            SelectCustomerWindow window = new SelectCustomerWindow();
            if (window.ShowDialog() == true)
            {
                _frame.Navigate(new InvoiceView(window.SelectedCustomer));
            }
        }
    }
}
